//
//  Collection+Safe.swift
//  CCFoundation_Swift
//
//  Created by zjh on 2021/11/24.
//

import UIKit
//下标安全的处理
extension Collection {
    subscript (safe index: Index) -> Iterator.Element? {
        return indices.contains(index) ? self[index] : nil
    }
}
